import scanFile from '../../utils/scanFile'
import resBody from '~/server/utils/resBody'

// 获取前端项目的页面目录结构
export default defineEventHandler(async (event) => {
  const tree = scanFile('/webapp/src/views/')
  // console.log('tree', tree)

  if (tree) {
    return resBody.success(tree)
  } else {
    return resBody.error(500)
  }
})
